package com.vmj.classfile.entity.constantinfo;

import com.vmj.classfile.ClassReader;
import com.vmj.classfile.entity.AbstractConstantInfo;

/**
 * Created by yangshoujun on 2017/8/6 上午11:29.
 */
public class ConstantStringInfo extends AbstractConstantInfo {

    int stringIndex;
    String value;

    public String getValue() {
        return getConstantPool().getUtf8(stringIndex);
    }

    public ConstantStringInfo(ClassReader reader) {
        super(reader);
    }

    public void parse() {
        stringIndex = getReader().readTwoByte();
    }

    public int getStringIndex() {
        return stringIndex;
    }

    public void setStringIndex(int stringIndex) {
        this.stringIndex = stringIndex;
    }
}
